#ifndef STRINGNUMBER_H
#define STRINGNUMBER_H

#include "Number.h"
#include "Integer.h"
#include "WordList.h"
#include <string>

class StringNumber : public Number
{
public:
	StringNumber();
	StringNumber(std::string n);
	~StringNumber() {};
    int integer;
    std::string word;
	std::string roman;
	int toInteger() const;
	std::string toRomanNumeral() const;
	std::string toWordNumber() const;

	bool operator>(const StringNumber& rhs) const;
	bool operator<(const StringNumber& rhs) const;
	bool operator>=(const StringNumber& rhs) const;
	bool operator<=(const StringNumber& rhs) const;
	bool operator==(const StringNumber& rhs) const;
	bool operator!=(const StringNumber& rhs) const;

	std::string operator+(const StringNumber& a) const;
	std::string operator-(const StringNumber& a) const;
	std::string operator*(const StringNumber& a) const;
	std::string operator/(const StringNumber& a) const;
	std::string operator%(const StringNumber& a) const;
private:
	virtual bool parse();
	std::string tokenize(std::string &s);
	int toIntegerOperation(std:: string s);
	std::string toRomanNumeralOperation();

	bool startState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool zeroState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool oneToNineState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool tenToNineteenState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool twentyToNinetyState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool twentyToNinetyAndOneToNineState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool hundredOneToNineState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool hundredTwentyToNinetyState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool hundredState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool thousandState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	bool terminalState(std::string &s, WordtoTokenMap m, WordtoValueMap v);
	std::string currentToken;
	std::string previousToken;
};

#endif
